1. Field of the Invention
The disclosure invention relates generally to load balancing among servers. More particularly but not exclusively, the present disclosure relates to handling of canonical names (CNAMES) in load balancing systems that provide the address of a server expected to serve the client with a high performance in a given application.
2. Description of the Related Art
Under the TCP/IP protocol, when a client provides a symbolic name (“URL”) to request access to an application program or another type of resource, the host name portion of the URL needs to be resolved into an IP address of a server for that application program or resource. For example, the URL (e.g., http://www.foundrynet.com/index.htm) includes a host name portion www.foundrynet.com that needs to be resolved into an IP address. The host name portion is first provided by the client to a local name resolver, which then queries a local DNS server to obtain a corresponding IP address. If a corresponding IP address is not locally cached at the time of the query, or if the “time-to-live” (TTL) of a corresponding IP address cached locally has expired, the DNS server then acts as a resolver and dispatches a recursive query to another DNS server. This process is repeated until an authoritative DNS server for the domain (e.g., foundrynet.com, in this example) is reached. The authoritative DNS server returns one or more IP addresses, each corresponding to an address at which a server hosting the application (“host server”) under the host name can be reached. These IP addresses are propagated back via the local DNS server to the original resolver. The application at the client then uses one of the IP addresses to establish a TCP connection with the corresponding host server. Each DNS server caches the list of IP addresses received from the authoritative DNS for responding to future queries regarding the same host name, until the TTL of the IP addresses expires.
To provide some load sharing among the host servers, many authoritative DNS servers use a simple round-robin algorithm to rotate the IP addresses in a list of responsive IP addresses, so as to distribute equally the requests for access among the host servers.
The conventional method described above for resolving a host name to its IP addresses has several shortcomings. First, the authoritative DNS does not detect a server that is down. Consequently, the authoritative DNS server continues to return a disabled host server's IP address until an external agent updates the authoritative DNS server's resource records. Second, when providing its list of IP addresses, the authoritative DNS sever does not take into consideration the host servers' locations relative to the client. The geographical distance between the server and a client is a factor affecting the response time for the client's access to the host server. For example, traffic conditions being equal, a client from Japan could receive better response time from a host server in Japan than from a host server in New York. Further, the conventional DNS algorithm allows invalid IP addresses (e.g., that corresponding to a downed server) to persist in a local DNS server until the TTL for the invalid IP address expires.
One technique to address these shortcomings is a global server load balancing system provided by Foundry Networks, Inc. of Santa Clara, Calif. As one example, Foundry provides the ServerIron product to add intelligence to authoritative DNS servers by serving as a proxy to these servers. The ServerIron has a global server load balancing (GSLB) feature that intelligently uses health-checks and other methods to assess the availability and responsiveness of the host sites in the DNS reply. When necessary, the ServerIron exchanges the IP address at the top of the address list returned by the authoritative DNS with another IP address selected from the list, based on a set of performance metrics indicative of which particular host server may provide the optimum access. Thus, the GSLB feature ensures that a client always receives a DNS reply for a host site that is available and is the best choice among the available hosts. Example embodiments for global server load balancing are disclosed in U.S. application Ser. No. 09/670,487, entitled “GLOBAL SERVER LOAD BALANCING,” filed Sep. 26, 2000, assigned to the same assignee as the present application, and which is incorporated herein by reference its entirety.
Canonical names (CNAMEs) are one of the different types of DNS resource records that reside on the authoritative DNS server. A CNAME is used to indicate that the resource record is an alias for another address record (or “A record”) on the authoritative DNS server. That is, a CNAME refers to (e.g., maps to) another domain name (A record) instead of mapping to an IP address. When the authoritative DNS server looks up a name and finds a CNAME record, it replaces the name with the canonical name and looks up the new name. Typically, on the authoritative DNS server, there is one or more CNAME records pointing to an address record, which in turn points to one or more IP addresses. For example, the authoritative DNS server can have the A record www.foundrynet.com and the CNAME records www1.foundrynet.com, www2.foundrynet.com, www3.foundrynet.com, all pointing to the A record www.foundrynet.com. Thus, while there may be potentially hundreds to thousands of aliases/CNAMEs associated with a particular domain name, they nevertheless “share” the same IP addresses since the CNAMEs map to a common A record corresponding to the IP addresses.
In one GSLB implementation, when an authoritative DNS server resolves a host name portion in a query and returns one or more IP addresses, the GSLB switch (such as a Serverlron configured for GSLB in a manner described above) applies the GSLB algorithm to the IP address list and returns a ranked list of IP addresses to the inquirer, provided the respective host name is configured on the GSLB switch. If a host name is not configured for GSLB, the GSLB switch does not apply the GSLB algorithm on DNS replies (received from the authoritative DNS server) pertaining to that host name. This behavior provides flexibility to a system administrator, to selectively load-balance only the required domains and hosts. However, for systems that have huge lists of CNAME records on their DNS servers and that wish to use GSLB to load balance all of these hosts, configuration of each and every one of the hosts on the GSLB switch is needed. This creates a significant amount of configuration overhead for systems that have large numbers of CNAMEs.